define( function(){
        
        
    return function(spriteImage) {        
        
        var imageBuffer;
        
        var init = function(spriteImage){
            var canvas = document.createElement('canvas');
            canvas.width = spriteImage.width;
            canvas.height = spriteImage.height;
            imageBuffer = canvas.getContext('2d');            
            imageBuffer.drawImage(spriteImage, 0, 0);
        };
        
        this.getSprite = function(x,y,w,h){
            var imgData = imageBuffer.getImageData(x,y,w,h);
            var sprite = document.createElement("canvas");
            sprite.width=w;
            sprite.height=h;            
            sprite.getContext('2d').putImageData(imgData, 0,0);
            return sprite;            
        };
        
    
        init(spriteImage);
    };
    
});